package org.jeecg.modules.base.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.CacheConstant;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.base.entity.SysDict;
import org.jeecg.modules.base.mapper.SysDict2Mapper;
import org.jeecg.modules.base.service.ISysDictService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典表 服务实现类
 * </p>
 *
 * @Author zhangweijian
 * @since 2018-12-28
 */
@Service
@Slf4j
public class SysDictServiceImpl2 extends ServiceImpl<SysDict2Mapper, SysDict> implements ISysDictService2 {

	@Autowired
    private SysDict2Mapper sysDict2Mapper;

	@Override
	@Cacheable(value = CacheConstant.SYS_ENABLE_DICT_CACHE,key = "#code", unless = "#result == null ")
	public List<DictModel> queryEnableDictItemsByCode2(String code) {
		log.debug("无缓存dictCache的时候调用这里！");
		return sysDict2Mapper.queryEnableDictItemsByCode2(code);
	}



}
